<extend name="Layout:ly1"/>

<block name="head">
    <script>
        $(document).ready(function () {
            var Table = $('table');
            var DataTable = Table.DataTable({
                language: dataTables_zh_CN,
                pageLength: 10,
                aaSorting: [
                    [0,"desc"]
                ]
            });

            //编辑信息
            $('body').delegate('table tr td .update','click',function(){
                var url = $(this).parents('tr').data('edit');
                layer.open({
                    type: 2,
                    title: '编辑用户',
                    shadeClose: true,
                    shade: 0.8,
                    area: ['50%', '630px'],
                    content: url
                });
            })
        });
    </script>
</block>

<block name="body">
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">专家等级列表</h1>
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        专家列表
                        <!--<a id="add" class="pull-right">添加专家等级</a>-->
                    </div>
                    <!-- /.panel-heading -->
                    <div class="panel-body">
                        <div class="dataTable_wrapper">
                            <table class="table table-bordered table-hover">
                                <thead>
                                    <tr>
                                        <th align="center">ID</th>
                                        <th>职称</th>
                                        <th>添加时间</th>
                                        <th>修改时间</th>
                                        <th width="15%">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <foreach name="data" item="v" key="k" >
                                        <tr id="id_{$v.userid}" data-id="{$v.userid}" data-status="{$v.status}" data-edit="{:U('Admin/ExpertLevel/level_edit',['id'=>$v['level_id']])}">
                                            <td align="center">{$v.level_id}</td>
                                            <td>{$v.level_title}</td>
                                            <td>{:date("Y-m-d H:i:s",$v['addtime'])}</td>
                                            <td>{:date("Y-m-d H:i:s",$v['updatetime'])}</td>
                                            <td align="center">
                                                <button class="btn btn-warning update">修改</button>
                                            </td>
                                        </tr>
                                    </foreach>
                                </tbody>
                            </table>
                        </div>
                        <!-- /.table-responsive -->
                    </div>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->
            </div>
            <!-- /.col-lg-12 -->
        </div>
    </div>
    <!-- /#page-wrapper -->
</block>